import hzcRequest from "../../../utils/https";


//立即购买确认

const getConfirmOrderByGoods=(data)=>{
    return hzcRequest.post(`/getConfirmOrderByGoods`,data)
}

// 确认订单(购物车)
const getConfirmOrderByCar=(data)=>{
    return hzcRequest.post(`/getConfirmOrderByCar`,data)
}

// 预付订单(立即购买)
const saveNowPreGoodsOrder=(data)=>{
    return hzcRequest.post(`/saveNowPreGoodsOrder`,data)
}

//购物车(预付订单)

const savePreGoodsOrder=(data)=>{
    return hzcRequest.post(`/savePreGoodsOrder`,data)
}



// getGoodsOrderPage
//订单列表
const getGoodsOrderPage=(data)=>{
    return hzcRequest.post(`/getGoodsOrderPage`,data)
}
// 取消订单
const cancelGoodsOrder=(data)=>{
    return hzcRequest.post(`/cancelGoodsOrder`,data)
}

//确认收货confirmGoodsOrderArrival
const confirmGoodsOrderArrival=(data)=>{
    return hzcRequest.post(`/confirmGoodsOrderArrival`,data)
}
//删除订单

const delGoodsOrder=(data)=>{
    return hzcRequest.post(`/delGoodsOrder`,data)
}

//根据订单编号获取订单token

const getGoodsOrderLogistics = (data) => {
  return hzcRequest.post(`/getGoodsOrderLogistics`,data
  );
};

//退款明细
const getOrderItemSaleData=(data)=>{
    return hzcRequest.post(`/getOrderItemSaleData`,data)
}


// 预付订单savePreOrder
const savePreOrder=(data)=>{
    return hzcRequest.post(`/h5Shop/api/ln/savePreOrder`,data)
}




//付款
const payOrderCallbackTest=(data)=>{
    return hzcRequest.post(`/h5Shop/api/ln/payOrderCallbackTest`,data)
}


// getGoodsOrderPage







//订单详情confirmGoodsOrderArrival
const getGoodsOrderDetails=(data)=>{
    return hzcRequest.post(`/getGoodsOrderDetails`,data)
}

//售后提交
const saveOrderItemSale=(data)=>{
    return hzcRequest.post(`/saveOrderItemSale`,data)
}


//门店订单列表getPackageOrderPage
const getPackageOrderPage=(data)=>{
    return hzcRequest.post(`/getPackageOrderPage`,data)
}


//门店订单详情
const getPackageOrderDetails=(data)=>{
    return hzcRequest.post(`/getPackageOrderDetails`,data)
}


//门店订单详情
const cancelPackageOrderPay=(data)=>{
    return hzcRequest.post(`/cancelPackageOrderPay`,data)
}

//退款原因

const getPackageRefundReason=(data)=>{
    return hzcRequest.post(`/getPackageRefundReason`,data)
}
//申请退款

const savePackageRefundApply=(data)=>{
    return hzcRequest.post(`/savePackageRefundApply`,data)
}




// 微信小程序下单
const placeOrder = (data) => {
  return hzcRequest.post(`/api/order/placeOrder`, data);
};

// 微信支付接口
const weixinPay = (data) => {
  return hzcRequest.post(`/api/pay/wxPay`, data);
};



// 我的订单
const orderInfoByTypeAndStatus = (data) => {
  return hzcRequest.post(
    `/api/order/orderInfoByTypeAndStatus?orderType=${data.orderType}&status=${data.status}&current=${data.current}&size=${data.size}`
  );
};

//订单更新状态
const updateOrderStatusByOrderSn = (data) => {
  return hzcRequest.post(`/api/order/updateOrderStatusByOrderSn`, data);
};





// // 按订单编号查询订单
// const getOrderInfoByOrderSnApi = (params) => {
//   return hzcRequest.post(`/api/order/getOrderInfoByOrderSn?orderSn=${params}`);
// };

// 取消退款
const cancelApi = (data) => {
  return hzcRequest.post(`/api/order/cancel`, data);
};

// 申请退款
const refundOrder = (data) => {
  return hzcRequest.put(`/api/refundOrder/refundOrder`, data);
};

export {
	getConfirmOrderByGoods,
	getConfirmOrderByCar,
	saveNowPreGoodsOrder,
	savePreGoodsOrder,
	savePreOrder,
	payOrderCallbackTest,
	getGoodsOrderPage,
	cancelGoodsOrder,
	delGoodsOrder,
	getOrderItemSaleData,
	confirmGoodsOrderArrival,
	getGoodsOrderDetails,
	getGoodsOrderLogistics,
	saveOrderItemSale,
	//门店操作
	getPackageOrderPage,
	getPackageOrderDetails,
	cancelPackageOrderPay,
	getPackageRefundReason,
	savePackageRefundApply,
	
	
	
  refundOrder,
  cancelApi,
  placeOrder,
  weixinPay,
  orderInfoByTypeAndStatus,
  updateOrderStatusByOrderSn,
};
